{include file="common/header.tpl"}
<section class="main">
	<nav class="left-col">{include file="common/navi-share.tpl"}</nav>
    <article class="right-col">
    	<h2>Cẩm nang{if isset($smarty.session.share_manual) && ($smarty.session.share_manual&1<<0) > 0} &raquo; <a href="{$smarty.const.HOST_BACKEND}smanual/add">Thêm mới</a>{/if}</h2>
        {include file="smanual/search.tpl"}
        <form name="frmNews" id="frmNews" action="{$smarty.const.HOST_BACKEND}smanual/act" method="post" enctype="multipart/form-data">
            <input type="hidden" name="paction" id="paction"/>
            {if $arrResult}
            	{if isset($smarty.session.share_manual)}   
                	<div class="s-button">  
                        {if ($smarty.session.share_manual&1<<4) > 0}
                        	<button type="button" onclick="javascript:confirmPending(this.form);">Tạm dừng</button>
                        {/if}  
                        {if ($smarty.session.share_manual&1<<5) > 0}
                        	<button type="button" onclick="javascript:confirmActive(this.form);">Kích hoạt / Phục hồi</button>
                        {/if}                                                                                   
                        {if ($smarty.session.share_manual&1<<3) > 0} 
                        	<button type="button" onclick="javascript:confirmDelete(this.form);">Xóa</button>
                            {if $AppUI->type > 2}
                            	<button type="button" onclick="javascript:confirmDeleteDb(this.form);">Xóa khỏi Db</button> 
                            {/if}
                        {/if}
                	</div>
                {/if}
                {if $intTotal > 0}
                	<div class="s-page">
                    	<strong class="total">Tổng số {$intTotal}</strong>
                        {paging total=$intTotal limit=$intLimit offset=$intOffset url=$strUrl}
                    </div>
                {/if}                
            {/if}
            <table width="100%" cellpadding="0" cellspacing="0" border="0" class="list">
                <thead>
                    <tr>
                        {if $arrResult && isset($smarty.session.share_manual) && ( (($smarty.session.share_manual&1<<3)>0) || (($smarty.session.share_manual&1<<4)>0) )}
                            <th width="16"><input type="checkbox" name="pcheckall" id="pcheckall" onclick="javascript:checkAll(this.form,'pid[]',this.checked);"/></th>
                        {/if}
                        <th width="130">Hình minh họa</th>                                       
                        <th width="150">Tiêu đề</th>
                        <th>Tóm lược nội dung</th>
                        <th width="80">Flash/video</th>            
                        <th width="70">Tình trạng</th>
                        <th width="80">Ngày đăng</th>
                        {if $arrResult && ($smarty.session.share_manual&1<<2)>0}
                            <th width="20">&nbsp;</th>
                        {/if}
                    </tr>
                </thead>
                <tbody>
                    {if $arrResult}
                        {foreach item=item from=$arrResult}
                            <tr class="{cycle values="odd,even"}">
                                {if isset($smarty.session.share_manual) && ((($smarty.session.share_manual&1<<3)>0) || (($smarty.session.share_manual&1<<4)>0))}
                                    <td align="center">
                                        <input type="checkbox" id="pid{$item.id}" name="pid[]" value="{$item.id}" onclick="javascript:checkOneItem(this.form, 'pcheckall')"/>
                                    </td>
                                    
                                {/if}
                                <td>{image path=$item.image type="share" size=2 attr="style=\"width:130px;\""}</td>
                                <td>
                                    {$item.title}                       
                                </td>
                                <td> 
                                    {$item.short|strip_tags}
                                </td>
                                <td align="center">
                                    {if $item.flash != ""}
                                        <img src="{$smarty.const.HOST_STATICS}backend/img/ad-accept.png" alt="" border="0" width="16" height="16" />
                                    {else}
                                        <img src="{$smarty.const.HOST_STATICS}backend/img/ad-unaccept.png" alt="" border="0" width="16" height="16" />
                                    {/if}
                                </td>
                                <td align="center">
                                    {if $item.status == 0}
                                        <img src="{$smarty.const.HOST_STATICS}backend/img/ad-unaccept.png" width="16" height="" alt="Tạm dừng" border="0" title="Tạm dừng" />
                                    {elseif $item.status == 1}
                                         <img src="{$smarty.const.HOST_STATICS}backend/img/ad-accept.png" alt="Đang kích hoạt" border="0" width="16" height="16" />
                                    {elseif $item.status == 2}
                                        <img src="{$smarty.const.HOST_STATICS}backend/img/ad-cancel.png" alt="Bị xóa" border="0" width="16" height="16" />
                                    {/if}
                                </td>
                                <td align="center">{$item.postdate|date_format:"%d/%m/%Y"}<br/>{$item.postdate|date_format:"%H:%M:%S"}</td>
                                {if ($smarty.session.share_manual&1<<2)>0}
                                	<td align="center">
                                        <a href="{$smarty.const.HOST_BACKEND}smanual/edit?id={$item.id}" title="Cập nhật thông tin">
                                            <img src="{$smarty.const.HOST_STATICS}backend/img/ad-edit.png" alt="Edit" border="0" width="16" height="16" />
                                        </a>
                                	</td>
                                {/if}
                            </tr>
                        {/foreach}
                    {else}
                        <tr><td colspan="7" align="center">Không có dữ liệu</td></tr>
                    {/if}
                </tbody>
            </table>
            {if $arrResult}
            	{if $intTotal > 0}
                	<div class="s-page">
                    	<strong class="total">Tổng số {$intTotal}</strong>
                        {paging total=$intTotal limit=$intLimit offset=$intOffset url=$strUrl}
                    </div>
                {/if}  
            	{if isset($smarty.session.share_manual)}   
                	<div class="s-button">  
                        {if ($smarty.session.share_manual&1<<4) > 0}
                        	<button type="button" onclick="javascript:confirmPending(this.form);">Tạm dừng</button>
                        {/if}  
                        {if ($smarty.session.share_manual&1<<5) > 0}
                        	<button type="button" onclick="javascript:confirmActive(this.form);">Kích hoạt / Phục hồi</button>
                        {/if}                                                                                   
                        {if ($smarty.session.share_manual&1<<3) > 0} 
                        	<button type="button" onclick="javascript:confirmDelete(this.form);">Xóa</button>
                            {if $AppUI->type > 2}
                            	<button type="button" onclick="javascript:confirmDeleteDb(this.form);">Xóa khỏi Db</button> 
                            {/if}
                        {/if}
                	</div>
                {/if}        
            {/if}
        </form>
	</article>
</section>         
{include file="common/footer.tpl"}
                
